//
//  slideThirdBoard.m
//  EFExtend
//
//  Created by mac on 15/7/4.
//  Copyright (c) 2015年 Eric. All rights reserved.
//

#import "slideThirdBoard.h"
#import "slideRoot.h"
#import "slideLeft.h"
#import "slideRight.h"

@interface slideThirdBoard ()

@end

@implementation slideThirdBoard

- (void)dealloc
{
    
    HM_SUPER_DEALLOC();
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.customNavLeftBtn setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
    [self.customNavLeftBtn setFrame:CGRectMakeBound(32, 32)];
    
    [self.customNavRightBtn setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
    [self.customNavRightBtn setFrame:CGRectMakeBound(32, 32)];
    
    
    //    self.root.view.alpha = .6f;
    self.left.view.backgroundColor = [UIColor md_amber_100];
    self.right.view.backgroundColor = [UIColor md_amber_100];
    self.top.view.backgroundColor = [UIColor md_amber_100];
    self.bottom.view.backgroundColor = [UIColor md_amber_100];
    self.view.backgroundColor = [UIColor md_red_100];
    
    self.options = UISlideOptionsNormal;
    
    self.leftWidth = 200;
    self.homePage = URLFOR_controllerWithNav(@"slideRoot");
    
    [self slideToggleToHomeAndClosePre:NO];
    
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

ON_Button(signal){
    UIButten *btn = signal.source;
    if ([signal is:[UIButten TOUCH_UP_INSIDE]]) {
        if ([btn is:@"leftBtn"]) {//customNavLeftBtn
            [self backAndRemoveWithAnimate:YES];
        }else if ([btn is:@"rightBtn"]){//customNavRightBtn
            [self toggleAuto:UISlideStateLeft animated:YES];
        }
    }
}


- (UIViewController *)slideControllerForPosition:(SlidePosition)position{
    switch (position) {
        case SlidePositionLeft:
            return [slideLeft board];
            break;
        case SlidePositionRight:
            return [[HMUIStack alloc]initWithRootViewController:[slideRight board]];
            break;
        default:
            break;
    }
    return nil;
}

@end
